public class Test {
    public static void main(String[] args) {
        String s1="hello";
        String s2="hello";//当只有双引号引起来的话他会直接去StringTable中去找
        String s3=new String("hello");
        String s4=new String("hello");
        System.out.println(s1==s2);//true
        System.out.println(s1==s3);//false
        System.out.println(s3==s4);//false
//        char[] arr={'a','b','c'};
//        String s5=new String(arr);
//        String s6="abc";
//        System.out.println(s5==s6);//false
        char[] arr={'a','b','c'};
        String s5=new String(arr);
        s5.intern();//放入常量池中去
        String s6="abc";
        System.out.println(s5==s6);//true
    }
}
